<?php
namespace app\validate;

use think\Validate;

class Exchange extends Validate
{
    protected $rule = [
        'receive_name' => 'require|max:10',
        'mobile' => 'require|length:11|number',
        'province' => 'require|chs',
        'city' => 'require|chs',
        'area' => 'require|chs',
        'address' => 'require',
        'tradepass' => 'require',
        'good_id' => 'require',
        //'uid' => 'require|member',
    ];

    protected $message = [
        'receive_name.require' => '必须填写收件人',
        'receive_name.max'     => '收件人过长',
        'mobile.require' => '必须填写手机号',
        'mobile.mobile'  => '必须是手机号',
        'mobile.length'     => '手机号必须是11位',
        'mobile.number'  => '手机号必须是数字',
        'province.require'  => '省份必须',
        'province.chs'  => '省份传值必须是汉字',
        'city.require'  => '市必须',
        'city.chs'  => '市传值必须是汉字',
        'area.require'  => '地区必须',
        'area.chs'  => '地区传值必须是汉字',
        'address.require'  => '地址必须',
        'tradepass.require'  => '二级密码必须',
        'good_id.require'  => '商品ID必须',
        'good_id.member'  => '商品ID必须为数字',
        //'uid.require'  => '用户UID必须',
        //'uid.member'  => '用户UID必须为数字',
    ];
}


